package view;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

public class ServerStateView {
    @JsonProperty("total_memory")
    public double totalMemory;
    @JsonProperty("available_memory")
    public double availableMemory;
    @JsonProperty("used_memory")
    public double usedMemory;
    @JsonProperty("memory_usage_rate")
    public double memoryUsageRate;
    @JsonProperty("cpu_usage_rate")
    public double cpuUsageRate;
    @JsonProperty("ip")
    public String ip;
    @JsonProperty("intranet_iP")
    public String intranet_ip;
    @JsonProperty("used_ports")
    public List<Integer> used_ports;

    public ServerStateView(double totalMemory, double availableMemory, double usedMemory, double memoryUsageRate,
            double cpuUsageRate, String ip, String intranet_ip, List<Integer> used_ports) {
        this.totalMemory = totalMemory;
        this.availableMemory = availableMemory;
        this.usedMemory = usedMemory;
        this.memoryUsageRate = memoryUsageRate;
        this.cpuUsageRate = cpuUsageRate;
        this.ip = ip;
        this.intranet_ip = intranet_ip;
        this.used_ports = used_ports;
    }

    public ServerStateView(double totalMemory, double availableMemory, 
        double usedMemory, double memoryUsageRate, double cpuUsageRate)
    {
        this.totalMemory = totalMemory;
        this.availableMemory = availableMemory;
        this.usedMemory = usedMemory;
        this.cpuUsageRate = cpuUsageRate;
        this.memoryUsageRate = memoryUsageRate;
        this.ip = "";
        this.intranet_ip = "";
        this.used_ports = new ArrayList<>();
    }
}
